<style>
    .clear{width:100%;height:0;clear:both;}
    .alert{margin:1px 0;padding:10px 15px;background:#F5F5F5;}
    .item-show .reply-news-list-cover{width:30%;height:100px;float:right;overflow:hidden;}
    .item-show .reply-news-list-cover img{width:100%;height:auto;}
    .item-show .reply-news-list-detail{width:65%;float:left;overflow:hidden;height:auto}
    .item-show .reply-news-list-detail .help-block{margin:5px 0}

    .item-list-first .reply-news-list-cover{width:100%;height:200px;;overflow:hidden;}
    .item-list-first .reply-news-list-cover img{width:100%;height:auto;}
    .item-list-first .reply-news-list-detail{width:100%;position:absolute;bottom:0;left:0;overflow:hidden;height:50px;color:#FFF;filter:Alpha(opacity=70);background:#000;background:rgba(0, 0, 0, 0.7);text-shadow:none;font-family:arial,宋体b8b\4f53,sans-serif;}
    .item-list-first .help-block{padding:0 10px}
    .item-list-first .pull-right{position:absolute;bottom:10px;right:0}
</style>
<div id="form" class="panel panel-default">
	<div class="panel-heading">
		选择要展示的酒店
	</div>
	<div class="panel-body">
		<div id="new-reply" class="row {if empty($hotel)}hide{/if}">
			<div class="reply-item">
				<div id="entry-preview" class="col-sm-12 item-show  item-list-first">
					<div class="alert">
						<div style="position:relative">
							<div class="reply-news-list-cover">
								<img src="{php echo tomedia($hotel['thumb']);}" title="{$hotel['title']}" />
							</div>
							<div class="reply-news-list-detail">
								<span class="help-block title"><strong>{$hotel['title']}</strong></span>
								<span class="help-block content">{php echo cutstr(strip_tags($hotel['description']), 50)}</span>
							</div>
							<div class="clear"></div>
						</div>
					</div>
				<input type="hidden" name="hotel" value="{$hotel['id']}"/>
			</div>
		</div>
	</div>
	<div class="col-sm-12">
		<div class="alert" style="text-align:center;">
			<a class="btn btn-default" href="javascript:;" onclick="$('#modal-module-menus').modal();"><i class="fa fa-plus"></i> 选择要展示的酒店</a>
		</div>
	</div>
</div>
<div id="modal-module-menus" class="modal fade" tabindex="-1">
	<div class="modal-dialog" style='width:920px;'>
	<div class="modal-content">
	<div class="modal-header">
		<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
		<h3>选择要展示的酒店</h3>
	</div>
	<div class="modal-body">
		<div class="row">
			<label for="">搜索关键字</label>
			<div class="input-group">
				<input type="text" class="form-control" name="keyword" value="" id="search-kwd" />
				<span class='input-group-btn'><button type="button" class="btn btn-default" onclick="search_entries();">搜索</button></span>
			</div>
		</div>
		<div id="module-menus"></div>
	</div>
	<div class="modal-footer"><a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a></div>
	</div>
	</div>
</div>
<script type="text/javascript">
	function search_entries() {
		$('#module-menus').html("正在查询，请稍后...");
		var kwd = $.trim($('#search-kwd').val());
		$.post('{php echo $this->createWebUrl('hotel',array('op'=>'query'));}', {keyword: kwd}, function(dat){
			$('#module-menus').html(dat);
		});
	}
	function select_hotel(o) {
		$("#modal-module-menus .close").click();
		$('#entry-preview img').attr('src', o.thumb);
		$('#entry-preview .title').html(o.title);
		$('#entry-preview .content').html(o.description);
		$('#entry-preview').show();
		$('#new-reply').removeClass('hide');
		$(':hidden[name="hotel"]').val(o.id);
	}
</script>
